<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('新增医院个性化配置')" />
    <th:block th:include="include :: select2-css"/>
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-hospitalIndividuation-add">

            <div class="form-group">
                <label class="col-sm-3 control-label is-required">医疗机构单位：</label>
                <div class="col-sm-8">
                    <select name="hospitalId" id="hospitalId" class="form-control" th:with="v=${@dep.getCurrentDeptList()}" required>
                        <option value="" >------请选择医疗机构------</option>
                        <option th:each="l:${v}" th:text="${l.deptName}" th:value="${l.deptId}"></option>
                    </select>
                    <span class="help-block m-b-none"><i class="fa fa-info-circle"></i> 代码生成请选择字典属性</span>
                </div>
            </div>



            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">字典类型：</label>
                <div class="col-sm-8">
                    <input name="dictType" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">字典值：</label>
                <div class="col-sm-8">
                    <input name="dictValue" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">状态：</label>
                <div class="col-sm-8">
                    <div class="radio-box" th:each="dict : ${@dict.getType('sys_normal_disable')}">
                        <input type="radio" th:id="${'status_' + dict.dictCode}" name="status"
                               th:value="${dict.dictValue}"
                               th:checked="${dict.default}">
                        <label th:for="${'status_' + dict.dictCode}" th:text="${dict.dictLabel}"></label>
                    </div>
                </div>
            </div>
            <div class="form-group" shiro:hasAnyRoles="admin">
                <label class="col-sm-3 control-label">删除：</label>
                <div class="col-sm-8">
                    <div class="radio-box" th:each="dict : ${@dict.getType('del_flag')}">
                        <input type="radio" th:id="${'delFlag_' + dict.dictCode}" name="delFlag"
                               th:value="${dict.dictValue}" th:checked="${dict.default}">
                        <label th:for="${'delFlag_' + dict.dictCode}" th:text="${dict.dictLabel}"></label>
                    </div>
                </div>
            </div>

            <div class="form-group">
                <label class="col-sm-3 control-label">备注：</label>
                <div class="col-sm-8">
                    <textarea id="remark" name="remark" maxlength="400" class="form-control"></textarea>
                </div>
            </div>


        </form>
    </div>
    <th:block th:include="include :: footer" />
    <th:block th:include="include :: select2-js"/>
    <script type="text/javascript">
        var prefix = ctx + "yf/hospitalIndividuation"
        $("#form-hospitalIndividuation-add").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/add", $('#form-hospitalIndividuation-add').serialize());
            }
        }
    </script>
</body>
</html>